<template>
  <div class="home">
    <div class="homeNav">
      <div class="home_sel">
          <select name="" id="">
          <option value="gz">广州</option>
          <option value="sz">深圳</option>
        </select>
      </div>
      <div class="link">
        <router-link class="link_left" to="/home/playing">正在热映</router-link>
        <router-link class="link_right" to="/home/comming">即将上映</router-link>
      </div>
      <div class="home_sou">搜索</div>
    </div>
    <!-- home下的子路由  children -->
    <router-view />
  </div>
</template>

<script>
import '../scss/home.scss';

export default {
  name: "home",
  created() {
  },
  data(){
    return {
    }
  },
  methods: {
    // 修改图片尺寸
    picFix(url){
      return url.replace('w.h','128.180');
    },
    // 跳转电影页
    toMovie(id){
      /* 当我点击的时候，跳转到movie页面，并且把movieId的id传过去 */
      this.$router.push({name:"movie",params:{ movieId : id } })
    },
    toAbout() {
      /* console.log(this);
      // 路由对象的方法 push就是跳转
      // query 查询字符串的参数   /about?id=4396&name=777
      this.$router.push({
        path: "/about",
        query: {
          id: 4396,
          name: 777
        } */
      //});

      // 跳转命名路由   传参使用params   /about

      // this.$router.push({ name: 'about',
      //   params:{
      //     id:4396
      //   }
      // })
    },
    toMine(){
      // 跳转 动态路由 /mine/:userId    userId = 1234
      // this.$router.push({ path: "/home/1234/comming" });

      // /home/:id/comming
      // this.$router.push({ name:'comming',params:{
      //   id:1234
      //  } })
    }
  },
  components: {
    // HelloWorld
  }
};
</script>


<style lang="scss" >

</style>
